# Find installed ReadLine

# find include path
find_path(ReadLine_INCLUDE_DIR
   NAMES readline/readline.h
   DOC "ReadLine include path"
)

# find static library
find_library(ReadLine_LIBRARY
   NAMES readline
   DOC "ReadLine API static library path"
)

set(ReadLine_INCLUDE_DIRS ${ReadLine_INCLUDE_DIR})
set(ReadLine_LIBRARIES ${ReadLine_LIBRARY})

if (ReadLine_INCLUDE_DIR AND ReadLine_LIBRARY)
   set(ReadLine_FOUND TRUE)
   if (NOT ReadLine_FIND_QUIETLY)
      message (STATUS "Found ReadLine: ${ReadLine_LIBRARY}")
   endif()
else()
   set(ReadLine_FOUND FALSE)
   if (ReadLine_FIND_REQUIRED)
      message(FATAL_ERROR "Could not find ReadLine")
   endif()
endif()
